package com.intretech.tj.mqtt.Source;

import com.intretech.tj.mqtt.entity.MessageInfo;
import com.intretech.tj.mqtt.entity.QosMessageInfo;
import com.intretech.tj.mqtt.entity.RetainMessageInfo;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public interface MessageInterface {
    /**
     * qos消息Map<br/>
     * qos大于0时写入<br/>
     * key:消息ID<br/>
     * value:消息信息
     */
    Map<Integer, QosMessageInfo> qosMessageMap = new ConcurrentHashMap<>();

    /**
     * retain消息Map<br/>
     * retain为true时写入
     */
    Map<String, RetainMessageInfo> retainMessageMap = new ConcurrentHashMap<>();

    /**
     * 接收消息写入Map
     *
     * @param messageInfo 收到的消息信息
     */
    void receive(MessageInfo messageInfo);
}
